<a name="comment-form"></a>
<%= tag('div', :style=>(@comment.nil? ? "display:none;" : ''), :class=>"addCommentForm", :id=>'div-comment-form') %>
    <div class="content">
    	<% form_for :comment, :url => comments_path do |f| %>
		   <%= f.hidden_field :commentable_type, :value => model.class.to_s %>
		   <%= f.hidden_field :commentable_id, :value => model.id %>
			 <%= f.hidden_field :root_id %>
		   <%= hidden_field_tag :referrer, @template.request.url %>
        <table cellspacing="0" cellpadding="0" border="0">
          <tbody>
						<tr>
		          <td align="right" style="padding: 5px 5px 0px 0px;"><strong>от:</strong></td>
		          <td>
								<% if logged_in? %>
									<%= link_to current_user.login, user_path(current_user), :class=>current_user.user_css %>
								<% else %>
									<%= f.text_field :user_name %>					
								<% end %>
							</td>
		        </tr>
          <tr>
            <td align="right" style="padding: 5px 5px 0px 0px;"><strong>тема:</strong></td>
            <td style="padding-top: 5px;">
            	<%= f.text_field :title, :style=>"width: 340px; margin-right: 30px;"%>
            	<% if logged_in? %>
            		<strong>выбрать картинку:</strong>
								<%= f.collection_select :avatar_id, current_user.avatars, :id, :filename, {:include_blank=>'картинка по умолчанию'}, {:style=>"width: 150px;"} %>
            	<% end %>
            </td>
          </tr>
        </tbody></table>
        <div style="padding-top: 5px;">
        		<%= f.text_area :comment, :style=>'width: 725px;', :rows=>8 %>
        </div>
				<%= show_simple_captcha(:object=>'comment', :image_style => 'simply_blue') unless logged_in? %>
        <div class="submit">
        		<%= submit_tag "добавить комментарий"%>
        </div>
        <% end %>
    </div>
</div>
